﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DXApplicationTangche.UC.货号管理.service;
using DevExpress.XtraGrid.Demos.util;
using DXApplicationTangche.UC.订单一览新.辅料.辅料下单;
using DXApplicationTangche.UC.订单一览新.订单预览新.model;
using DXApplicationTangche.UC.订单一览新.辅料.service;

namespace DXApplicationTangche.UC.货号管理.销售款式
{
    public partial class Form销售样衣辅料维护 : DevExpress.XtraEditors.XtraForm
    {
        //uc
        //private XtraUserControl辅料选择 uC辅料 = new XtraUserControl辅料选择();
        //model;
        private 订单预览新Model model;
        private String barcode;
        private String saleInventoryMatialId;
        public Form销售样衣辅料维护(String barcode,String saleInventoryMatialId)
        {
            InitializeComponent();
            this.barcode = barcode;
            this.saleInventoryMatialId = saleInventoryMatialId;
            try
            {
                this.model = new 订单预览新Model(this.barcode, Enum订单查询.按照水洗标查询订单);
            }
            catch (Exception)
            {
                MessageBox.Show("请扫描扫描成衣条码");
            }
            // 辅料uc
            //this.uC辅料 =
            //    new XtraUserControl辅料选择(
            //        new 标识StyleAccessoryDTO(false, this.model.OrderCommitDTO返回.styleAccessoryDTOs),
            //        this.model.OrderCommitDTO返回.materialCode
            //        );
            //this.uC辅料.Dock = DockStyle.Fill;
            //this.panel辅料.Controls.Clear();
            //this.panel辅料.Controls.Add(this.uC辅料);
        }

        private void simpleButton确认_Click(object sender, EventArgs e)
        {
            try
            {
                //调用接口更新销售样衣下的辅料清单
                //货号管理Service.saveSaleInventoryAccessory(
                //    this.barcode,
                //    this.saleInventoryMatialId,
                //    this.uC辅料.build().styleAccessoryDTOs
                //    );
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            this.Close();
        }
    }
}